﻿#parse("partials/header.html") #parse("partials/sidebar.html")
<script type="text/javascript">
    $(document).ready(function () {

        ///Search Doctor
        var oTable = $('#datalist').dataTable({
            "bSort": false,
            "sPaginationType": "full_numbers",
            "bProcessing": true,
            "bServerSide": true,
            "bFilter": true,
            "sAjaxSource": rooturl + "home/popup/tablelistdoctor",
            "aoColumns": [
                            { "mDataProp": "Id" },
                            { "mDataProp": "DoctorCode" },
                            { "mDataProp": "DoctorName" },
                            { "mDataProp": "Specialist" },
            //flag
                            {"mDataProp": "TotalAppointment" },
                            { "mDataProp": "PatientQueue" }
                        ],
            "aoColumnDefs": [
                                {
                                    "fnRender": function (o) {
                                        return "<center><a class='dok' title='Select Doctor' href='" + rooturl + "patientdata/default/?doctorenkrp=" + o.aData['doctorenkrp'] + "'><img src='/images/Icons/table.png'/></a> </center>";

                                    },
                                    "aTargets": [0]
                                }
                        ],
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({ "name": "doctorname", "value": $('#doctorname').val() });
                aoData.push({ "name": "code", "value": $('#code').val() });
                aoData.push({ "name": "TextBoxDoctorSpecialist", "value": $('#TextBoxDoctorSpecialist').val() });
                jQuery.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": rooturl + "home/popup/tablelistdoctor",
                    "data": aoData,
                    "success": function (data) {
                        if (data.error != null) {
                            OnloadDialog();
                        } 
                        else if (data.ExceptionMessage != null) {
                            alert(data.ExceptionMessage);
                        } 
                        fnCallback(data);
                    }
                });
            }
        });

        function checkForEnter(event) {
            if (event.keyCode == 13) {
                oTable.fnDraw();
            }
        }

        $('#doctorname').keypress(checkForEnter);
        $('#code').keypress(checkForEnter);
        $('#buttonSearch').click(function () { oTable.fnDraw(); });


    });
    //End Document.ready
    function OnloadDialog() {
        jQuery("#dialog-confirm-timeout").dialog({
            resizable: false,
            draggable: false,
            closeText: 'hide',
            height: 180,
            modal: true,
            buttons: {
                "Ok": function () {
                    try {
                        parent.ReLogin();

                    } catch (e) {
                        window.location = rooturl + "home/default/login/";
                    }
                }
            }
        });

    }
</script>
<!--mws-container Start-->
<style>
    div#datalist_filter
    {
        display: none;
    }
    div#datalist_length
    {
        display: none;
    }
    .mws-table thead
    {
        margin-top: -10px;
    }
</style>
<div id="dialog-confirm-timeout" title="Confirmation" style="display: none">
    <p>
    </p>
    <p>
        <span class="ui-icon ui-icon-alert" style="float: left; margin: 3px 20px 40px 50px;">
        </span>
        Session has timeout.
        <br />
        Do you want to Re-Login?
</div>
<div id="mws-container" class="clearfix">
    <!-- Inner Container Start -->
    <div class="container">
        <!-- Panels Start -->
        <div class="mws-panel grid_8">
            <div class="title-caption">
                <h5>$headerinformation  - $Lob - Patient Registration</h5>
            </div>
            <div class="mws-panel-header">
                <span class="mws-i-24 i-table-1">Doctor List</span>
            </div>
            <div class="mws-panel-body">
                <div class="mws-panel-toolbar top clearfix">
                    <ul>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/frontoffice/lobselection/?redirectUri=patientdata/default" title="Search">Select LOB</a></li>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/patientdata/default" title="List">Search
                            Patient</a></li>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/frontoffice/registration/searchdoctor"
                            title="List">Doctor List</a></li> 
                        <li><a class="mws-ic-16 ic-application-view-list" href="/frontoffice/registration/searchappointment"
                            title="List">Appointment List </a></li>
                       
                        <li><a class="mws-ic-16 ic-add" href="/patientdata/default/patientdetail" title="Add">
                            New Patient Data Registration</a></li>
                        <!--<li><a class="mws-ic-16 ic-accept" href="/frontoffice/registration/registrationlist"
                            title="Accept">Registration List</a></li>-->
                    </ul>
                </div>
                <br />
                <div class="mws-form" action="#">
                    <div class="mws-form-inline">
                        <div class="mws-form-row">
                            <label>
                                Doctor Name</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-2-8 alpha">
                                        <div class="mws-form-item">
                                            <input class="mws-textinput" id="doctorname" name="Name" type="text" value="" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Code</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-2-8 alpha">
                                        <div class="mws-form-item">
                                            <input class="mws-textinput" id="code" name="Code" type="text" value="" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Specialist</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-2-8 alpha">
                                        <div class="mws-form-item">
                                            <!--<input class="mws-textinput" id="TextBoxDoctorSpecialist" name="TextBoxDoctorSpecialist"
                                                type="text" value="" />-->
                                            $ddlSpecialists
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <br />
                    <div class="mws-button-row">
                        <input id="buttonSearch" class="mws-button red" type="submit" value="Search" />
                    </div>
                </div>
                <table cellpadding="0" cellspacing="0" border="0" class="fullwidth mws-table" id="datalist"
                    width="80%">
                    <thead>
                        <tr>
                            <th style="width: 10px; text-align: center">
                                Actions
                            </th>
                            <th style="width: 100px; text-align: center">
                                CODE
                            </th>
                            <th style="text-align: center">
                                Doctor Name
                            </th>
                            <th style="text-align: center">
                                Specialist
                            </th>
                            <th style="width: 50px; text-align: center">
                                Total Appointment
                            </th>
                            <th style="width: 50px; text-align: center">
                                Patient Queue
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="6" class="dataTables_empty">
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <!-- Panels End -->
    </div>
    <!-- Inner Container End -->
</div>
<!--mws-container End-->
#parse("partials/footer.html")